package com.fanhang.samples.redis.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fanhang.samples.redis.dao.UserDao;
import com.fanhang.samples.redis.po.User;
import com.fanhang.samples.redis.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;
	
	@Override
	public void save(User user) {
		userDao.save(user);
		userDao.publish("create user: " + user.getUserName());
	}

	@Override
	public User get(User user) {
		 return userDao.get(user);
	}

	@Override
	public List<User> getList(User user) {
		return userDao.getList(user);
	}
	
}
